package LUCKY.Android.ResourceAccess;

import java.util.TimerTask;

import com.google.code.microlog4android.Logger;
import com.google.code.microlog4android.LoggerFactory;

import LUCKY.Android.valoresGenerales;
import android.app.Activity;
import android.content.Context;
import android.os.Handler;

public class TimerGetTablasAux extends TimerTask {
	private Handler m_handler = null;
	private Activity m_activity;
	private Context m_context; 
	private int m_IdOperario=0;
	private int m_sincronizar=0;
	private static final String CLASS_NAME = "TimerGetTablasAux";
    private static final Logger logger = LoggerFactory.getLogger();
	
	
	public TimerGetTablasAux(Handler handler,Activity activity, Context context,int IdOperario,int sincronizar)
	{
		m_handler=handler;
		m_activity=activity;
		m_context=context; 
		m_IdOperario=IdOperario;
		m_sincronizar=sincronizar;
	}
    private Runnable runnable = new Runnable() {
        public void run() {
        	if(!valoresGenerales.gettingTablaAux && !valoresGenerales.gettingSincroManten){
        		valoresGenerales.gettingTablaAux=true;
				new AsyncGetTablasAux(m_handler,m_activity,m_context).execute(String.valueOf(m_IdOperario),String.valueOf(m_sincronizar));
				
        	}
        }
    };
    public void run() {
    	m_handler.post(runnable);
    }
}